//package com.kafka.listener;
//
//import com.alibaba.fastjson.JSONObject;
//import org.apache.kafka.clients.producer.ProducerRecord;
//import org.apache.kafka.clients.producer.RecordMetadata;
//import org.springframework.kafka.support.ProducerListener;
//import org.springframework.stereotype.Component;
//
///**
// * @author zhangbowen
// * @date 2019/3/25
// **/
//@Component("CallBackListener")
////同意回调broker消息确认(当用自定义的回复 replyTemplate需要配置produce)
////单独使用template也能生效(存在replyTemplate,该listener就不生效需要config配置)
//public class CallBackListener implements ProducerListener {
//    @Override
//    public void onSuccess(ProducerRecord producerRecord, RecordMetadata recordMetadata) {
//        System.out.println("produce message" + producerRecord);
//        System.out.println("Send ok" + recordMetadata);
//    }
//
//    @Override
//    public void onError(ProducerRecord producerRecord, Exception exception) {
//        exception.printStackTrace();
//        System.out.println("发送错误" + producerRecord.toString() + "错误为" + JSONObject.toJSON(exception));
//    }
//}
